package com.hj.entity;

// Generated 2012-4-29 18:09:10 by Hibernate Tools 3.2.2.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import javax.persistence.Version;

import org.hibernate.annotations.BatchSize;
import org.hibernate.annotations.GenericGenerator;

/**
 * AcctUser generated by hbm2java
 */
@Entity
@Table(name = "acct_user", catalog = "standardweb", uniqueConstraints = @UniqueConstraint(columnNames = "login_name"))
public class AcctUser implements java.io.Serializable {

	private Long id;
	private String email;
	private String loginName;
	private String name;
	private String password;
	private String createdBy;
	private Date createdDate;
	private String lastModifiedBy;
	private Date lastModifiedDate;
	private Integer new_;
    private Long recordVersion;
	private List<AcctGroup> acctGroups = new ArrayList<AcctGroup>();

	public AcctUser() {
	}

	public AcctUser(String loginName, Date createdDate, Date lastModifiedDate) {
		this.loginName = loginName;
		this.createdDate = createdDate;
		this.lastModifiedDate = lastModifiedDate;
	}

	public AcctUser(String email, String loginName, String name, String password, String createdBy, Date createdDate,
			String lastModifiedBy, Date lastModifiedDate, Integer new_, List<AcctGroup> acctGroups) {
		this.email = email;
		this.loginName = loginName;
		this.name = name;
		this.password = password;
		this.createdBy = createdBy;
		this.createdDate = createdDate;
		this.lastModifiedBy = lastModifiedBy;
		this.lastModifiedDate = lastModifiedDate;
		this.new_ = new_;
		this.acctGroups = acctGroups;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name = "email")
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "login_name", unique = true, nullable = false)
	public String getLoginName() {
		return this.loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(name = "name")
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "password")
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "created_by", length = 20)
	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "created_date", nullable = false, length = 19)
	public Date getCreatedDate() {
		return this.createdDate;
	}

	public void setCreatedDate(Date createdDate) {
		this.createdDate = createdDate;
	}

	@Column(name = "last_modified_by", length = 20)
	public String getLastModifiedBy() {
		return this.lastModifiedBy;
	}

	public void setLastModifiedBy(String lastModifiedBy) {
		this.lastModifiedBy = lastModifiedBy;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_modified_date", nullable = false, length = 19)
	public Date getLastModifiedDate() {
		return this.lastModifiedDate;
	}

	public void setLastModifiedDate(Date lastModifiedDate) {
		this.lastModifiedDate = lastModifiedDate;
	}

	@Column(name = "new")
	public Integer getNew_() {
		return this.new_;
	}

	public void setNew_(Integer new_) {
		this.new_ = new_;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "acct_user_group", catalog = "standardweb", joinColumns = { @JoinColumn(name = "user_id", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "group_id", nullable = false, updatable = false) })
	@BatchSize(size = 10)
	public List<AcctGroup> getAcctGroups() {
		return this.acctGroups;
	}

	public void setAcctGroups(List<AcctGroup> acctGroups) {
		this.acctGroups = acctGroups;
	}
	@Column(name="record_version")
    @Version 
    public Long getRecordVersion() {
        return this.recordVersion;
    }
    
    public void setRecordVersion(Long recordVersion) {
        this.recordVersion = recordVersion;
    }
}
